home *** CD-ROM | disk | FTP | other *** search
/ Quarterdeck InternetSuite / Quarterdeck InternetSuite.iso / qsockpro.qip / METRONET.MPS < prev    next >
Encoding:
Text File  |  1996-03-20  |  1.7 KB  |  80 lines

  1. # Texas Metronet PPP and SLIP script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95 CEL
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. # TRACE ON  
  14.  
  15. SetTimeout 60
  16.  
  17.  
  18. # Get username from access method
  19. CfgGetValue "Username" username
  20.  
  21. # if the Username field is empty, prompt the user for it.
  22. IF result = 0 THEN
  23.     GetInput "Enter your user name" username
  24.     IF result = 0 THEN
  25.         PRINT "Warning, no username entered"
  26.     ELSE
  27.         PRINT "Username set to:"; username
  28.     ENDIF
  29. ENDIF
  30.  
  31. # get password from access method
  32. CfgGetValue "Password" password
  33.  
  34. # if the Password field is empty, prompt the user for it.
  35. IF result = 0 THEN
  36.     GetPassword "Enter your password" password
  37.     IF result = 0 THEN
  38.         PRINT "Warning, no password entered"
  39.     ELSE
  40.         PRINT "Password set."
  41.     ENDIF
  42. ENDIF
  43.  
  44. # get framing layer (MPPPP, MPSLIP)
  45. # abort with an error if we can't read the Framing setting
  46. CfgGetValue "Framing" framing
  47. IF result = 0 THEN
  48.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  49. ENDIF
  50.  
  51. CommWaitFor "login:"
  52.  
  53. # The character before the user name indicates the type of connection.
  54. IF framing = "MPPPP" THEN
  55.     CommSend   "P"
  56. ENDIF
  57. IF framing = "MPSLIP" THEN
  58.     CommSend   "S"
  59. ENDIF
  60.  
  61. CommSend username
  62. CommSend "%r"
  63.  
  64. CommWaitFor "Password:"
  65.     CommSend password
  66.     CommSend "%r"
  67.  
  68. # if SLIP, we need to get the IP address
  69. # wait for string that precedes IP address then get IP address
  70. IF framing = "MPSLIP" THEN
  71.     PRINT "%rGetting IP address for SLIP"
  72.  
  73.     CommWaitFor ") to"
  74.         CommReadIPAddr IPAddress
  75.     CfgSetValue "IPAddress" IPaddress
  76.     PRINT "%rIP Address set to:"; IPAddress
  77. ENDIF
  78.  
  79. END                          
  80.